import { SchemaFactory, Prop, Schema } from '@nestjs/mongoose'
import { Document } from 'mongoose'
export type UserDocument = User & Document

@Schema({ timestamps: true })
export class User extends Document {
  //用户名
  @Prop({ required: true })
  username: string
  //密码
  @Prop({ required: true })
  password: string
  //邮箱
  @Prop({ required: true })
  email: string

  //手机号
  @Prop({ required: true })
  phone: string

  //头像
  @Prop({ default: null })
  photo: string

  //好友数量\
  @Prop({ default: 0 })
  friendCount: number
}

export const UserSchema = SchemaFactory.createForClass(User)
